package utils;

import org.hibernate.Session;

public class TransactionTemplate {
	 private static Session s ;
	 public static void beginTransaction(){
    	 s = HbnUtil.getSession();
    	 s.beginTransaction();
     }
     public static void commit(){
    	 if(s!=null && s.isOpen()){
    	    s.getTransaction().commit();
    	 }
     }
     public static void rollback(){
    	 if(s!=null && s.isOpen()){
    	    s.getTransaction().rollback();
    	 }      
     }
}
